
export default G6 => {
  G6.registerBehavior('node-collaspe', {
    getEvents () {
      return {
        'node:click': 'nodeOnClick',
        'node:dblclick': 'nodeDblclick',
      };
    },
    nodeOnClick (e) {
      const value = e.target.cfg.collaspe;
      e.item.setState('collapse-expand', value);
    },
    nodeDblclick (e) {
      if(e.target.cfg.isLoadingChildren){
          e.item.setState('collapse-expand', false);
      }
    },
  });
};
